package com.demo7;

/**
 * Created by Administrator on 2017/3/27.
 */
class FatherClass2 {
    public String str1 = "父类的public属性";
    protected String str2 = "父类的protected属性";
}

class SonClass2 extends FatherClass2 {
    void print() {
        SonClass2 son = new SonClass2();
        System.out.println("在子类的方法中: ");
        System.out.println(son.str1);
    }
}

public class FengZhuang3 {
    public static void main(String[] args) {
        SonClass2 son2 = new SonClass2();
        son2.print();
    }
}
